package com.kyl.controller;


import com.kyl.base.ResponseResult;
import com.kyl.service.RoomService;
import com.kyl.vo.RoomVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author WanJl
 * @version 1.0
 * @title RoomController
 * @description
 * @create 2025/1/18
 */
@RestController
@RequestMapping(value = "/room")
@Api(tags = "房间管理相关接口")
public class RoomController {
    @Resource
    private RoomService roomService;

    @GetMapping("/getRoomsWithNurByFloorId/{floorId}")
    @ApiOperation(value = "获取所有房间（负责老人）", notes = "负责老人模块的根据楼层id查询所有房间")
    public ResponseResult<List<RoomVo>> getRoomsWithNurByFloorId(@PathVariable Long floorId) {
        return ResponseResult.success(roomService.getRoomsWithNurByFloorId(floorId));
    }

    @GetMapping("/getRoomsByFloorId/{floorId}")
    @ApiOperation(value = "获取所有房间（入住配置）", notes = "负责在住管理床位房型的根据楼层id查询所有房间")
    public ResponseResult<List<RoomVo>> getRoomsByFloorId(@PathVariable Long floorId) {
        return ResponseResult.success(roomService.getRoomsByFloorId(floorId));
    }
}
